﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Converters="using:WinKee.Converters"
    xmlns:controls="using:WinKee.Controls"
    x:Class="WinKee.Pages.EntryDetails"
    mc:Ignorable="d"
    DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.BottomAppBar>
        <CommandBar>
            <CommandBar.PrimaryCommands>
                <AppBarButton HorizontalAlignment="Center" Label="Username" Command="{Binding CopyUsernameCommand}" >
                    <AppBarButton.Icon>
                        <SymbolIcon VerticalAlignment="Center" HorizontalAlignment="Center" Symbol="Contact" />
                    </AppBarButton.Icon>
                </AppBarButton>
                <AppBarButton Label="Password" HorizontalAlignment="Center" Command="{Binding CopyPasswordCommand}">
                    <AppBarButton.Icon>
                        <SymbolIcon HorizontalAlignment="Center" VerticalAlignment="Center" Symbol="Permissions" />
                    </AppBarButton.Icon>
                </AppBarButton>
            </CommandBar.PrimaryCommands>
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="Security notice" Command="{Binding ShowWarningCommand}"/>
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </Page.BottomAppBar>
    
    <Page.Resources>
        <Converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
        <Converters:NegativeBoolToVisibilityConverter x:Key="NegativeBoolToVisibilityConverter"/>
    </Page.Resources>

    <Grid x:Name="LayoutRoot">

        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- TitlePanel -->
        <StackPanel Grid.Row="0" Margin="24,17,0,28">
            <TextBlock Text="WinKee" Style="{ThemeResource TitleTextBlockStyle}" Typography.Capitals="SmallCaps"/>
            <TextBlock Text="entry details" Margin="0,12,0,0" Style="{ThemeResource HeaderTextBlockStyle}"/>
        </StackPanel>
        
        <Hub Name="EntryHub" Grid.Row="1" DataContext="{Binding Entry}">
            <HubSection Margin="5">
                <HubSection.Header>    
                    <TextBlock Text="main" Foreground="{StaticResource PhoneAccentBrush}" FontSize="30" />  
                </HubSection.Header>
                <DataTemplate>
                    <ScrollViewer>
                        <controls:MainEntrySection />
                    </ScrollViewer>  
                </DataTemplate>
            </HubSection>
            <HubSection Margin="5">
                <HubSection.Header>
                    <TextBlock Text="details" Foreground="{StaticResource PhoneAccentBrush}" FontSize="30" />
                </HubSection.Header>
                <DataTemplate>
                    <ScrollViewer>
                        <controls:DetailsEntrySection/>
                    </ScrollViewer>   
                </DataTemplate>
            </HubSection>
        </Hub>

        
    </Grid>
</Page>
